<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateReturnPerformancesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('return_performances', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('customer_id')->index()->default(0)->comment('客户id');
            $table->unsignedBigInteger('user_id')->index()->default(0)->comment('销售id');
            $table->string('disease')->default('')->comment('病种');
            $table->decimal('money', 20)->default(0.00)->comment('金额');
            $table->text('pay_images')->comment('付款截图');
            $table->text('remark')->nullable()->comment('备注');
            $table->unsignedTinyInteger('stage')->default(0)->comment('阶段');
            $table->string('delivery')->default('')->comment('到款及渠道');
            $table->string('drug')->default('')->comment('药物种类');
            $table->string('treatment_course')->default('')->comment('服药疗程');
            $table->decimal('subsidy')->default(0.00)->comment('大病补助费用');
            $table->string('invitation_user_ids')->default('')->comment('邀约人');
            $table->string('consultant_user_ids')->default('')->comment('会诊人');
            $table->unsignedBigInteger('doctor_option_id')->default(0)->comment('预约专家');
            $table->unsignedTinyInteger('channel')->default(0)->comment('资源渠道');
            $table->timestamp('channel_date')->nullable()->comment('资源时间');
            $table->timestamp('consultation')->nullable()->comment('看诊时间');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('return_performances');
    }
}
